<script>
var seelct_archives_url = '{{urlfor "ArchivesController.SelectArchives"}}';
var archives_edit_url = '{{ urlfor "ArchivesController.Edit"}}';
var reail_index_url =  '{{ urlfor "RetailController.Extract" }}';
var get_optometry_url = '{{ urlfor "RetailController.Optometry" }}';
var get_optometry_more_url = '{{ urlfor "RetailController.OptometryMore" }}';
var get_optometry_one_url = '{{ urlfor "OptometryController.View" }}';
var inventory_product_list_new_url = '{{ urlfor "RetailController.InventoryList" }}';
var save_add_sales_url = '{{ urlfor "RetailController.AddSales" }}';
var save_clear_sales_url = '{{ urlfor "RetailController.ClearSales" }}';
var pickup_pay_confirm_url = '{{ urlfor "RetailController.PickupPayConfirm" }}';
var sendout_pickup_pay_confirm_url = '{{ urlfor "RetailController.SendoutPickupPayConfirm" }}';
var custom_product_list_new_url = '{{ urlfor "RetailController.Custom" }}';
var hisoty_product_list_url = '{{ urlfor "RetailController.History" }}';
</script>
<script src="{{ getAssets }}js/retail.js?v={{ assets_version }}202412251423"></script>
<script>
    // 中国标准时间 转换成 年月日
    function getSimpleDate(date) {
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        m = m < 10 ? ('0' + m) : m;
        var d = date.getDate();
        d = d < 10 ? ('0' + d) : d;
        return y + '-' + m + '-' + d;
    }

    $('#created_at').val(getCurrentFormattedDate());
    $(function() {
        $('#created_at').datepicker({format: 'yyyy-mm-dd'}).
        on('changeDate.datepicker.amui', function(event) {
            $('#created_at').val(getSimpleDate(event.date));
        });
    });
</script>
